import axios from '../../index'
//获取用户信息
const getUserInfoAxios = (params) => {
        console.log(params);
        return axios({
            url: '/customer/getPage',
            method: "POST",
            data: params
        })
    }
    //搜索
const getCustomerBySearchAxios = (customer_Name) => {
        return axios({
            url: '/customer/getCustomerBySearch',
            method: "POST",
            data: {
                customer_Name
            }
        })
    }
    //获取字典
const getDicListAxios = (dic_Name) => {
    return axios({
        url: '/dic/getChildDicList',
        method: "POST",
        data: {
            dic_Name
        }
    })
}

//删除字典请求
const delDicAxios = (params) => {
        console.log(params);
        return axios({
            url: '/dic/delDic',
            method: "POST",
            data: params
        })
    }
    //新增字典
const addDicAxios = (params) => {
        return axios({
            url: '/dic/addDic',
            method: "POST",
            data: params
        })
    }
    //修改字典
const fixDicAxios = (params) => {
        return axios({
            url: '/dic/modifyDic',
            method: "POST",
            data: params
        })
    }
    //新增客户
const addCustomerAxios = (params) => {
        console.log(params);
        return axios({
            url: '/customer/addCustomer',
            method: "POST",
            data: params
        })
    }
    //删除客户
const delCustomerAxios = (params) => {
        console.log(params);
        return axios({
            url: '/customer/moveToTrash',
            method: "POST",
            data: params
        })
    }
    //批量删除
const moveToTrashAxios = (params) => {
        console.log(params);
        return axios({
            url: '/customer/moveToTrash',
            method: "POST",
            data: params
        })
    }
    //修改客户
const fixCustomerAxios = (params) => {
        console.log(params);
        return axios({
            url: '/customer/modifyCustomer',
            method: "POST",
            data: params
        })
    }
    //登录
const loginAxios = (params) => {
        console.log(params);
        return axios({
            url: '/Login',
            method: "POST",
            data: {
                employee_login: params.username,
                employee_password: params.PWD
            }
        })
    }
    //转移到指定业务员
const moveToOtherEmpAxios = (params) => {
    console.log(params);
    return axios({
        url: '/customer/moveToOtherEmp',
        method: "POST",
        data: params
    })
}

//转移到公海
const moveToCustomerPollAxios = (params) => {
        console.log(params);
        return axios({
            url: '/customer/moveToCustomerPoll',
            method: "POST",
            data: params

        })
    }
    //保护期例外设置
const modifyCustomerProtectedSettingAxios = (params) => {
        console.log(params);
        return axios({
            url: '/customer/modifyCustomerProtectedSetting',
            method: "POST",
            data: {
                customerIds: params.checkVal,
                protectedSetting: params.statusval
            }
        })
    }
    //获取指定条件的客户数量
const getCustomerCountByConditionAxios = (params) => {
        return axios({
            url: '/customer/getCustomerCountByCondition',
            method: "POST",
            data: {
                data: {
                    type: params
                },
            }
        })
    }
    //获取
const getqueryEmpListAxios = () => {
    return axios({
        url: '/employee/queryEmpList',
        method: "POST"
    })
}

export {
    getUserInfoAxios,
    getCustomerBySearchAxios,
    getDicListAxios,
    addDicAxios,
    delDicAxios,
    fixDicAxios,
    addCustomerAxios,
    delCustomerAxios,
    fixCustomerAxios,
    loginAxios,
    moveToOtherEmpAxios,
    moveToTrashAxios,
    moveToCustomerPollAxios,
    modifyCustomerProtectedSettingAxios,
    getCustomerCountByConditionAxios,
    getqueryEmpListAxios
}